<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"      
      xmlns:jsf="http://xmlns.jcp.org/jsf"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>        
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title><ui:insert name="title">default</ui:insert></title>
        <link rel="stylesheet" type="text/css" jsf:name="/style/style.css"/>
        <link rel="shortcut icon" jsf:name="/img/icone.ico" />
    </h:head>
    <h:body>
        <div class="top">
            <h:panelGroup rendered="${!loginManagedBean.logged}"> 
                <div class="menucredenciado" style="text-align: right;" >
                    <h:form prependId="false">
                        <label jsf:for="login">Login:</label>
                        <input type="text" jsf:id="login" jsf:value="${loginManagedBean.user.loginName}" />
                        <label jsf:for="password">Senha:</label>
                        <input type="password" jsf:id="password" jsf:value="${loginManagedBean.user.password}"/>
                        <input class="button" type="submit" jsf:id="submit" value="Entrar" jsf:action="${loginManagedBean.login()}"/>
                    </h:form>
                </div>
            </h:panelGroup>
            <h:panelGroup rendered="${loginManagedBean.logged}"> 
                <div class="menucredenciado">
                    <h:form>                 
                        <h:panelGroup rendered='${loginManagedBean.user.name == "admin"}'>
                            <a href="${request.contextPath}/pages/intranet/user/user.jsp">Usuário</a>
                        </h:panelGroup>
                        <a href="${request.contextPath}/pages/intranet/recorder/recorder.jsp">Gravadora</a>
                        <a href="${request.contextPath}/pages/intranet/genre/genre.jsp">Gênero</a>
                        <a href="${request.contextPath}/pages/intranet/city/city.jsp">Cidade</a>
                        <a href="${request.contextPath}/pages/intranet/artist/artist.jsp">Artista</a>
                        <a href="${request.contextPath}/pages/intranet/musician/musician.jsp">Músico</a>
                        <a href="${request.contextPath}/pages/intranet/album/album.jsp">Álbum</a>
                        <a href="${request.contextPath}/pages/intranet/song/song.jsp">Música</a>              
                        <label style="color: #ADD8E6">Bem-Vindo(a) #{loginManagedBean.user.name}</label>
                        <input class="button" type="submit" value="Sair" jsf:action="${loginManagedBean.logout}"/>                        
                    </h:form>
                </div>
            </h:panelGroup>
        </div>
        <div class="base">
            <div class="cabecalho">

            </div>
            <div class="menu">
                <a style="float:left;clear:left; margin-top:5px;text-decoration: underline" href="${request.contextPath}/pages/index.jsp">Home</a>        
                <h:form prependId="false">
                    <label for="selectBusca">Buscar por:</label>
                    <select size="1" name="selectBusca" jsf:value="${searchManagedBean.searchType}">
                        <f:selectItem itemLabel="Artista" itemValue="${searchManagedBean.SEARCH_ARTIST}"/>
                        <f:selectItem itemLabel="Música" itemValue="${searchManagedBean.SEARCH_MUSIC}"/>
                        <f:selectItem itemLabel="Álbum" itemValue="${searchManagedBean.SEARCH_ALBUM}"/>
                    </select>
                    <input type="text" jsf:value="${searchManagedBean.searchedWord}"/>
                    <input type="submit" class="button" jsf:id="artistSearch"                      
                          jsf:action="${searchManagedBean.search}" value="Buscar"/>    
                </h:form>
            </div>
            <div class="conteudo"><ui:insert name="container"/></div>
        </div>       
        <div class="rodape">
            Songs - 2013
            <br/>
            Eloyza Santos - 1290371213012
            <br/>
            Marcos Costa - 1290371213027
        </div>

    </h:body>
</html>


